/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author allankv
 */
@Entity
@Table(name = "occurrenceelement")
@NamedQueries({
    @NamedQuery(name = "Occurrenceelement.findAll", query = "SELECT o FROM Occurrenceelement o"),
    @NamedQuery(name = "Occurrenceelement.findByIdoccurrenceelement", query = "SELECT o FROM Occurrenceelement o WHERE o.idoccurrenceelement = :idoccurrenceelement"),
    @NamedQuery(name = "Occurrenceelement.findByCatalognumber", query = "SELECT o FROM Occurrenceelement o WHERE o.catalognumber = :catalognumber"),
    @NamedQuery(name = "Occurrenceelement.findByOccurrencedetail", query = "SELECT o FROM Occurrenceelement o WHERE o.occurrencedetail = :occurrencedetail"),
    @NamedQuery(name = "Occurrenceelement.findByOccurrenceremark", query = "SELECT o FROM Occurrenceelement o WHERE o.occurrenceremark = :occurrenceremark"),
    @NamedQuery(name = "Occurrenceelement.findByRecordnumber", query = "SELECT o FROM Occurrenceelement o WHERE o.recordnumber = :recordnumber"),
    @NamedQuery(name = "Occurrenceelement.findByIndividualcount", query = "SELECT o FROM Occurrenceelement o WHERE o.individualcount = :individualcount"),
    @NamedQuery(name = "Occurrenceelement.findByOccurrencestatus", query = "SELECT o FROM Occurrenceelement o WHERE o.occurrencestatus = :occurrencestatus"),
    @NamedQuery(name = "Occurrenceelement.findByOthercatalognumber", query = "SELECT o FROM Occurrenceelement o WHERE o.othercatalognumber = :othercatalognumber")})
public class Occurrenceelement implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idoccurrenceelement")
    private Integer idoccurrenceelement;
    @Basic(optional = false)
    @Column(name = "catalognumber")
    private String catalognumber;
    @Column(name = "occurrencedetail")
    private String occurrencedetail;
    @Column(name = "occurrenceremark")
    private String occurrenceremark;
    @Column(name = "recordnumber")
    private String recordnumber;
    @Column(name = "individualcount")
    private Integer individualcount;
    @Column(name = "occurrencestatus")
    private String occurrencestatus;
    @Column(name = "othercatalognumber")
    private String othercatalognumber;
    @ManyToMany(mappedBy = "occurrenceelementList", fetch = FetchType.LAZY)
    private List<Individual> individualList;
    @JoinTable(name = "occurrencerecordedby", joinColumns = {
        @JoinColumn(name = "idoccurrenceelement", referencedColumnName = "idoccurrenceelement")}, inverseJoinColumns = {
        @JoinColumn(name = "idrecordedby", referencedColumnName = "idrecordedby")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Recordedby> recordedbyList;
    @ManyToMany(mappedBy = "occurrenceelementList", fetch = FetchType.LAZY)
    private List<Associatedsequence> associatedsequenceList;
    @JoinTable(name = "occurrencepreparation", joinColumns = {
        @JoinColumn(name = "idoccurrenceelement", referencedColumnName = "idoccurrenceelement")}, inverseJoinColumns = {
        @JoinColumn(name = "idpreparation", referencedColumnName = "idpreparation")})
    @ManyToMany(fetch = FetchType.LAZY)
    private List<Preparation> preparationList;
    @OneToMany(mappedBy = "occurrenceelement", fetch = FetchType.LAZY)
    private List<Specimen> specimenList;
    @JoinColumn(name = "idsex", referencedColumnName = "idsex")
    @ManyToOne(fetch = FetchType.LAZY)
    private Sex sex;
    @JoinColumn(name = "idreproductivecondition", referencedColumnName = "idreproductivecondition")
    @ManyToOne(fetch = FetchType.LAZY)
    private Reproductivecondition reproductivecondition;
    @JoinColumn(name = "idlifestage", referencedColumnName = "idlifestage")
    @ManyToOne(fetch = FetchType.LAZY)
    private Lifestage lifestage;
    @JoinColumn(name = "idestablishmentmean", referencedColumnName = "idestablishmentmean")
    @ManyToOne(fetch = FetchType.LAZY)
    private Establishmentmean establishmentmean;
    @JoinColumn(name = "iddisposition", referencedColumnName = "iddisposition")
    @ManyToOne(fetch = FetchType.LAZY)
    private Disposition disposition;
    @JoinColumn(name = "idbehavior", referencedColumnName = "idbehavior")
    @ManyToOne(fetch = FetchType.LAZY)
    private Behavior behavior;

    public Occurrenceelement() {
    }

    public Occurrenceelement(Integer idoccurrenceelement) {
        this.idoccurrenceelement = idoccurrenceelement;
    }

    public Occurrenceelement(Integer idoccurrenceelement, String catalognumber) {
        this.idoccurrenceelement = idoccurrenceelement;
        this.catalognumber = catalognumber;
    }

    public Integer getIdoccurrenceelement() {
        return idoccurrenceelement;
    }

    public void setIdoccurrenceelement(Integer idoccurrenceelement) {
        this.idoccurrenceelement = idoccurrenceelement;
    }

    public String getCatalognumber() {
        return catalognumber;
    }

    public void setCatalognumber(String catalognumber) {
        this.catalognumber = catalognumber;
    }

    public String getOccurrencedetail() {
        return occurrencedetail;
    }

    public void setOccurrencedetail(String occurrencedetail) {
        this.occurrencedetail = occurrencedetail;
    }

    public String getOccurrenceremark() {
        return occurrenceremark;
    }

    public void setOccurrenceremark(String occurrenceremark) {
        this.occurrenceremark = occurrenceremark;
    }

    public String getRecordnumber() {
        return recordnumber;
    }

    public void setRecordnumber(String recordnumber) {
        this.recordnumber = recordnumber;
    }

    public Integer getIndividualcount() {
        return individualcount;
    }

    public void setIndividualcount(Integer individualcount) {
        this.individualcount = individualcount;
    }

    public String getOccurrencestatus() {
        return occurrencestatus;
    }

    public void setOccurrencestatus(String occurrencestatus) {
        this.occurrencestatus = occurrencestatus;
    }

    public String getOthercatalognumber() {
        return othercatalognumber;
    }

    public void setOthercatalognumber(String othercatalognumber) {
        this.othercatalognumber = othercatalognumber;
    }

    public List<Individual> getIndividualList() {
        return individualList;
    }

    public void setIndividualList(List<Individual> individualList) {
        this.individualList = individualList;
    }

    public List<Recordedby> getRecordedbyList() {
        return recordedbyList;
    }

    public void setRecordedbyList(List<Recordedby> recordedbyList) {
        this.recordedbyList = recordedbyList;
    }

    public List<Associatedsequence> getAssociatedsequenceList() {
        return associatedsequenceList;
    }

    public void setAssociatedsequenceList(List<Associatedsequence> associatedsequenceList) {
        this.associatedsequenceList = associatedsequenceList;
    }

    public List<Preparation> getPreparationList() {
        return preparationList;
    }

    public void setPreparationList(List<Preparation> preparationList) {
        this.preparationList = preparationList;
    }

    public List<Specimen> getSpecimenList() {
        return specimenList;
    }

    public void setSpecimenList(List<Specimen> specimenList) {
        this.specimenList = specimenList;
    }

    public Sex getSex() {
        return sex;
    }

    public void setSex(Sex sex) {
        this.sex = sex;
    }

    public Reproductivecondition getReproductivecondition() {
        return reproductivecondition;
    }

    public void setReproductivecondition(Reproductivecondition reproductivecondition) {
        this.reproductivecondition = reproductivecondition;
    }

    public Lifestage getLifestage() {
        return lifestage;
    }

    public void setLifestage(Lifestage lifestage) {
        this.lifestage = lifestage;
    }

    public Establishmentmean getEstablishmentmean() {
        return establishmentmean;
    }

    public void setEstablishmentmean(Establishmentmean establishmentmean) {
        this.establishmentmean = establishmentmean;
    }

    public Disposition getDisposition() {
        return disposition;
    }

    public void setDisposition(Disposition disposition) {
        this.disposition = disposition;
    }

    public Behavior getBehavior() {
        return behavior;
    }

    public void setBehavior(Behavior behavior) {
        this.behavior = behavior;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idoccurrenceelement != null ? idoccurrenceelement.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Occurrenceelement)) {
            return false;
        }
        Occurrenceelement other = (Occurrenceelement) object;
        if ((this.idoccurrenceelement == null && other.idoccurrenceelement != null) || (this.idoccurrenceelement != null && !this.idoccurrenceelement.equals(other.idoccurrenceelement))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entityBeans.Occurrenceelement[idoccurrenceelement=" + idoccurrenceelement + "]";
    }

}
